package cn.edu.scau.cmi.zenglinghong.adapter;

import java.util.List;

public class objectAdapter implements Target{
	@Override
	public List<Integer> sortInt(List<Integer> intList){
		SortUtil sortUnit = new SortUtil();
		return sortUnit.sortInt(intList);
	}
	
	@Override
	public List<Student> sortStudent(List<Student> studentList){
		int size = studentList.size();
		for(int i=0; i<size-1; i++) {
			for(int j=0; j<size-1-i; j++) {
				if(studentList.get(j).id > studentList.get(j+1).id) {
					Student temp = studentList.get(j);
					studentList.set(j, studentList.get(j+1));
					studentList.set(j+1, temp);
				}
			}
		}
		return studentList;
	}
}
